#pragma once

#include <QSqlTableModel>
#include <QWidget>
#include "MQSortFilterProxyModel.h"
#include "Register.h"
#include "LoginWidget.h"
namespace Ui {
class Welcom;
}

class Welcome : public QWidget
{
  Q_OBJECT

 public:
  explicit Welcome(QWidget *parent = nullptr);
  ~Welcome();

  void showTempHeader();
  void showUsers(bool visible);
  void showWelcoms(bool visible);

 protected:

 private slots:

  void onLogin(QString str,bool admin,int loan,int max);

  void on_btn_login_clicked();

  void on_btn_logout_clicked();

  void on_btn_note_clicked();

  void on_btn_find_clicked();

  void on_lineEdit_returnPressed();

  void on_btn_register_clicked();

  void on_btn_loan_clicked();

  void on_btn_return_clicked();

  void showLoanTable();

  void updateUserLoanAndUI(int loan);

  void on_btn_delay_clicked();

  void on_btn_man_user_clicked();

  void on_bnt_admin_submit_clicked();

  void on_bnt_admin_revert_clicked();

  void on_btn_man_book_clicked();

  void on_btn_man_loan_clicked();

  void on_btn_man_append_clicked();

  void on_btn_man_remove_clicked();

 private:
  Ui::Welcom *ui;
  Register *m_r=0;
  LoginWidget *m_l=0;
  QSqlTableModel *adminTable = 0;
};

